package com.sportizz.sport;

import com.sportizz.sport.R;

import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

public class Custom_dialog_class extends Dialog {

	public Activity c;
	public Dialog d;
	public Button ok;
	public String P_name,next;
	public TextView found;
	public TextView now_follow;
	public TextView txt_3;
	public boolean i_follow,upcoming;
	boolean sett;

	public Custom_dialog_class(Activity act, String player_name,
			boolean i_follow, String next_hour,boolean upcoming) {
		// TODO Auto-generated constructor stub
		super(act);
		this.c = act;
		this.P_name = player_name;
		this.i_follow = i_follow;
		this.next=next_hour;
		this.upcoming=upcoming;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.custom_dialog);

		found = (TextView) findViewById(R.id.txt_dia);
		now_follow = (TextView) findViewById(R.id.now_follow);
		txt_3 = (TextView) findViewById(R.id.Text3);

		if (i_follow == true && P_name == null) {
			found.setText("");
			now_follow
					.setText("Currently there is no schedule for any team, player or events you are following.");
			txt_3.setText("");
		} else if (i_follow == false && (P_name != null && !P_name.equals("check_back")) && upcoming == false) {
			now_follow.setVisibility(View.GONE);
			found.setText("No schedule found for " + P_name);
//			now_follow.setText("You are now following " + P_name);
			txt_3.setVisibility(View.GONE);
		} else if (i_follow == true && P_name.equalsIgnoreCase("not_following")) {
			found.setText("");
			now_follow
					.setText("You are currently not following any Team, Player or Sporting Event.");
			txt_3.setText("");
		}
		else if(upcoming == true && i_follow == false && next!=null)
		{
			found.setText("");
			now_follow
					.setText("Currently there is no schedule for next "+ next+".");
			txt_3.setText("");
		}
		else if(P_name.equals("check_back"))
		{
			found.setText("");
			now_follow
					.setText("Information does not exist now. Please check back later ");
			txt_3.setText("");
		}
	}
}